import React, { useState } from 'react'

export default function App () {
  const [count, setCount] = useState(10)
  const startTime = () => {
    setTimeout(() => {
      // debugger
      console.log(count)
    }, 10000)
  }
  return (
    <div>
      <h3>{count}</h3>
      <button onClick={() => setCount(count + 8)}>+8</button>
      <button onClick={startTime}>开启定时器</button>
    </div>
  )
}